﻿Imports System.Drawing

Public Class PictureViewer

    Private _image As Image = Nothing
    Public Property Image() As Image
        Get
            Return _image
        End Get
        Set(ByVal value As Image)
            _image = value
        End Set
    End Property


    Private Sub PictureViewer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Try
            Me.Size = New Size(_image.Width + 30, _image.Height + 50)
        Catch
            Me.Close()
        End Try

        PictureBox1.BackgroundImage = _image
    End Sub
End Class